﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControls_ProductFrontList : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
		// Retrieve Page from the query string
		string page = Request.QueryString["Page"];
		if (page == null) page = "1";
		// How many pages of products?
		int howManyPages = 1;
		// pager links format
		string firstPageUrl = "";
		string pagerFormat = "";

		firstPageUrl = Link.ToPage(page.ToString(), HttpContext.Current.Request.Url.AbsolutePath);
		pagerFormat = Link.ToPage("{0}", HttpContext.Current.Request.Url.AbsolutePath);

		// Retrieve list of products on catalog promotion
		productFrontList.DataSource =
		EF_Product.GetProduct(page, out howManyPages);
		productFrontList.DataBind();
		// have the current page as integer
		int currentPage = Int32.Parse(page);
    }
}